import Vue from 'vue'
import App from './App.vue'
import VueRouter from 'vue-router'
import router from './router/index'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import store from './store'
import './api/mock'

Vue.use(ElementUI)
Vue.use(VueRouter)
Vue.config.productionTip = false

new Vue({
  render: h => h(App),
  router,
  store,
  // 刷新后页面不会主动进行 addMenu 方法的操作，就会出现白屏，我们手动在页面创建前调用它就好了
  created() {
    store.commit('tab/addMenu',router)
  },
}).$mount('#app')
